n, m = map(int, input().split())
monster_time = list(map(int, input().split()))
human_time = list(map(int, input().split()))

if sum(human_time) > sum(monster_time):
    print('Y')
else:
    print('N')